<template>
  <div class="details">
    <van-nav-bar title="标题" left-text="返回" left-arrow @click-left="fanhui">
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
    <div class="titImg" >
      <img src="../../assets/image/lc.jpg" alt="" />
    </div>
    <van-tabs v-model="active">
      <tag-tab :desc="123"> </tag-tab>
      <tag-tab-ml></tag-tab-ml>
      <tag-tab-pj></tag-tab-pj>
    </van-tabs>
    <van-goods-action>
      <van-goods-action-icon icon="chat-o" text="咨询" @click="onClickIcon" />
      <van-goods-action-icon icon="cart-o" text="想学" @click="onClickIcon" />
      <van-goods-action-button
        type="danger"
        text="加入学习"
        @click="onClickButton"
      />
    </van-goods-action>
  </div>
</template>

<script>
import tag1 from "./detail_js.vue";
import tag2 from "./details_ml.vue";
import tag3 from "./details_pj.vue";
import {get} from '../../tools/request'
export default {
  data() {
    return {
      active: 0,
      courseDesc:'',
      courseList:'',
      courseEvaluate:''
    };
  },
  components: {
    tagTab: tag1,
    tagTabMl: tag2,
    tagTabPj: tag3,
  },
  methods: {
    onClickButton() {
      this.$router.push({ name: "dingdan" });
    },
    onClickIcon() {
      //侧边 小图标
    },
    fanhui() {
      this.$store.commit("tabShow");
      this.$router.go(-1);
    },
    
  },
  created() {
    this.$store.commit("tabHide");
  },
  mounted(){
    get('/api/l1/course/'+this.$route.query.id).then(r=>{
      this.courseData=r.data
      /* 已经取到数据了，按理说该写个props传到下一层组件渲染的，但是时间没有规划好 */
    })
  }
};
</script>

<style lang="scss">
.details {
  color: #233;
  img {
    width: 100%;
    height: 100%;
  }
  h4 {
    height: 34px;
    line-height: 34px;
  }
  .flr {
    float: right;
  }

  .titImg {
    height: 55vw;
  }
}
</style>
